import { Player } from "../modules/player/script/Player";
import { eventManager } from "../sgame/event/EventManager";
import { GameSocket } from "./socket/GameSocket";

class GLOBAL {
    private _gameSocket: GameSocket;
    public get gameSocket() {
        return this._gameSocket;
    }

    public set gameSocket(value: GameSocket) {
        this._gameSocket = value;
        eventManager.dispatch("global::gameSocketChange");
    }

    public me: Player;
    public token: string;   // 登录时的token
}


export const Global = new GLOBAL();